public class Solution {

    public boolean isPalindrome(String s) {
        String ret = "abcdefghijklmnopqlstuvwxyzABCDEFGHIJKLMNOPQLSTUVWXYZ";
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if(ret.contains(s.charAt(i)+"")){
                sb.append(s.charAt(i));
            }
        }
        int left = 0;
        int right = sb.length()-1;
        while(left < right) {
            if(sb.charAt(left) == sb.charAt(right)) {
                left++;
                right--;
            }else{
                return false;
            }
        }
        return true;
    }
}
